var form = layui.form;
form.verify({
    usern: [
        /^[0-9a-zA-Z_]{6,12}$/,
        '用户名由6-12位.数字,字母下划线组成'
    ],
    passw: [
        /^[\S]{6,12}$/,
        '密码由非空格的6-12位组成'
    ],
    repwd: function (value) {
        if ($(".pwd").val() != value) {
            return "两次密码不一致"
        }
    },
    //category-新增分类-规则
    ctname: [
        /^[\u4e00-\u9fa5]+$/,
        "分类名字只能是中文"

    ],
    aliname: [
        /^[a-zA-Z0-9]+$/,
        "别名只能是英文和数字"
    ],
    //repwd.html 验证规则 新旧密码不能相同
    diff: function (newvalue) {
        if ($(".layui-form input[name=oldPwd]").val() == newvalue) {
            return "新旧密码不能相同"
        }
    },
    same: function (value) {
        if ($(".newPwd").val() != value) {
            return "两次密码不一致"

        }
    }




})
